home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5628 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: ix.netcom.com!netnews
  2. From: swampwiz@ix.netcom.com(Jean P. Laborde )
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Anyone have any C++ programing challenges for me????
  5. Date: 6 Feb 1996 00:03:34 GMT
  6. Organization: Netcom
  7. Message-ID: <4f65sm$h3@ixnews2.ix.netcom.com>
  8. References: <4f5rl3$jue@newsbf02.news.aol.com>
  9. NNTP-Posting-Host: ix-no1-10.ix.netcom.com
  10. X-NETCOM-Date: Mon Feb 05  4:03:34 PM PST 1996
  11.  
  12. In <4f5rl3$jue@newsbf02.news.aol.com> diemacdie@aol.com (Diemacdie)
  13. writes: 
  14. >
  15. >I'm looking for ideas for programs to work on. I am a high school
  16. senior
  17. >and I'm looking to learn as much as I can about c++ for next year.
  18. Thanx
  19.  
  20. Here's a good one.
  21.  
  22. Build classes for the following:
  23.  
  24. BigInt
  25.  
  26. BigReal
  27.  
  28. String
  29.  
  30. BigInt will store a huge integer.  Bigreal will store a huge real # (it
  31. will have two BigInt's - the significant digits & the exponent.  The
  32. String will deal with character strings the way they should be (will
  33. take of the dynamic memory, etc.)
  34.  
  35. with the proper function, you could
  36.  
  37. BigInt i(12321932081293812739);
  38. BigInt j=2*i;
  39. j*=(j-i*i);
  40. cout << i << " " << j;
  41. //etc.
  42.  
  43. String name2("Diemacdie");
  44. String name1("John");
  45. String name3=name1+" "+name2;
  46. cout << name; (would print 'John Diemacdie');
  47.  
  48. <or>
  49.  
  50. if(name2==name3){ ~~~ } // can't do this with char* !
  51.  
  52. This is the stuff I had to do for my projects in C++ courses.  If you
  53. could do this you'll be on your way to being a good C++ programmer.
  54.  
  55.  
  56.